package cn.crex1.springboot.securitydemo.controller;

import org.springframework.security.core.context.SecurityContextHolder;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * @author ZZh
 */
@RestController
public class HelloController {

    /**
     * 测试
     * @return
     */
    @GetMapping("/hello")
    public String hello(){
        return "hello Spring Security";
    }

    @GetMapping("/info")
    public Object info(){
        return SecurityContextHolder.getContext().getAuthentication();
    }
}
